package com.itheima.pattern.t17_observer.demo2;

/**
 * JDK-Observable、Observer
 * Observable类是抽象目标类(被观察者)
 * Observer接口是抽象观察者
 */
public class TestDemo {

    public static void main(String[] args) {
        // 创建小偷对象
        Thief thief = new Thief("隔壁老王");
        // 创建警察对象
        Policemen policemen = new Policemen("小李");

        thief.addObserver(policemen);
        thief.steal();
    }
}
